package cn.nawang.ebeim.api.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import cn.nawang.ebeim.api.domain.HeartLog;

/**
 * @ClassName: HeartLogRepository
 * @Description: 心跳表的查询
 * @author fanyb
 * @date Aug 6, 2015 10:19:41 AM
 * @version v1.0
 */
public interface HeartLogRepository extends JpaRepository<HeartLog, String> {
  /**
   * 
   * @author fanyb
   * @Description: 获取该终端心跳列表
   * @param terminalId 终端编号
   * @return List<HeartLog> 该终端心跳列表
   * @date Aug 12, 201511:42:01 AM
   *
   * @修改人 
   * @修改日期
   */
  @Query("select hl from HeartLog hl where hl.level='1' and terminalId=?1 order by hl.actTime desc")
  public List<HeartLog> getLastOnlineTime(String terminalId);
}
